<template>
  <div class="home-landing">
    <!-- 英雄区 -->
    <section class="hero">
      <div class="hero-overlay"></div>
      <div class="hero-content">
        <div class="hero-pretitle">AI · 古籍 · 语义 · 探索</div>
        <h1 class="hero-title">
          <span class="title-cn">寻古 · 探典 · 明义</span>
          <span class="hero-brand">AncientSeeker</span>
        </h1>
        <p class="hero-sub">将传统典籍与智能语义融合，打造沉浸式知识寻踪体验</p>
        <div class="hero-actions">
          <el-button class="cta-btn" size="large" @click="goToLibrary">进入典籍库</el-button>
          <el-button class="secondary-btn" size="large" @click="goToChat">AI 对话</el-button>
          <el-button class="explore-btn" size="large" @click="goToExplore">探索模式</el-button>
        </div>
        <div class="hero-meta">
          <span>精选古籍结构化整理</span>
          <span>AI 辅助语义解读</span>
          <span>学习与探索一体化</span>
        </div>
      </div>
      <div class="hero-decor hero-decor--left"></div>
      <div class="hero-decor hero-decor--right"></div>
    </section>

    <!-- 功能特色 -->
    <section class="features container">
      <h2 class="section-title">核心功能</h2>
      <div class="features-grid">
        <div class="feature-card" @click="goToLibrary">
          <div class="icon-wrap"><span>📚</span></div>
          <h3>典籍库</h3>
          <p>结构化呈现《山海经》等典籍篇章，按章节/段落快速定位。</p>
          <el-tag size="small" type="info" effect="plain">文献基础</el-tag>
        </div>
        <div class="feature-card" @click="goToChat">
          <div class="icon-wrap"><span>🤖</span></div>
          <h3>AI对话</h3>
          <p>上下文语义理解，提出疑问即可获取解读与关联信息。</p>
          <el-tag size="small" type="success" effect="plain">语义交互</el-tag>
        </div>
        <div class="feature-card" @click="goToImage">
          <div class="icon-wrap"><span>🎨</span></div>
          <h3>AI绘图</h3>
          <p>基于段落意境生成风格化插图，增强沉浸体验。</p>
          <el-tag size="small" type="warning" effect="plain">视觉增强</el-tag>
        </div>
  <div class="feature-card" @click="goToExplore">
          <div class="icon-wrap"><span>🔍</span></div>
          <h3>探索模式</h3>
            <p>引导式任务链 + 知识路径追踪，沉浸式学习流。</p>
          <el-tag size="small" type="danger" effect="plain">深度体验</el-tag>
        </div>
        <!-- 移除首页 API 测试入口 -->
      </div>
    </section>

    <!-- 价值主张条 -->
    <section class="value-strip">
      <div class="value-item">
        <h4>语义解构</h4>
        <p>逐段关联背景、概念、意象，避免“只读字面”的浅层理解。</p>
      </div>
      <div class="value-item">
        <h4>多模态延展</h4>
        <p>文本 + 场景 + 图像生成，知识点具象化、故事化。</p>
      </div>
      <div class="value-item">
        <h4>探索闭环</h4>
        <p>阅读 → 提问 → 解读 → 生成 → 复盘，形成学习循环。</p>
      </div>
    </section>

    <footer class="landing-footer">
      <span>© {{ new Date().getFullYear() }} AncientSeeker</span>
      <span class="sep">·</span>
      <span>AI 古籍寻踪实验平台 (预览版)</span>
    </footer>
  </div>
</template>

<script setup>
import { useRouter } from 'vue-router'
import { getToken } from '@/utils/auth'

const router = useRouter()
const loggedIn = !!getToken()

const goToLibrary = () => router.push('/library')
const goToChat = () => router.push('/chat')
const goToImage = () => router.push('/image')
const goToExplore = () => router.push('/explore')
// TODO: 新探索入口将指向 /explore（待实现）
// 首页移除 API 测试入口
</script>

<style lang="scss" scoped>
@import '@/assets/styles/variables.scss';

.home-landing { position: relative; width:100%; }

/* Hero 区域 */
.hero { position:relative; padding: 110px 20px 90px; overflow:hidden; text-align:center; }
.hero-overlay { position:absolute; inset:0; background:
  radial-gradient(circle at 35% 28%, rgba(200,16,46,0.15), transparent 60%),
  radial-gradient(circle at 70% 65%, rgba(244,162,97,0.18), transparent 65%),
  linear-gradient(135deg, rgba(255,255,255,0.55), rgba(255,255,255,0.35));
  mix-blend-mode: normal; backdrop-filter: blur(6px) saturate(150%);
}
.hero-decor { position:absolute; width:420px; height:420px; background:radial-gradient(circle at center, rgba(231,111,81,0.22), rgba(200,16,46,0) 70%); filter:blur(40px); opacity:.65; pointer-events:none; }
.hero-decor--left { left:-120px; top:40px; }
.hero-decor--right { right:-140px; bottom:-40px; background:radial-gradient(circle at center, rgba(38,70,83,0.28), rgba(200,16,46,0) 70%); }

.hero-content { position:relative; max-width:880px; margin:0 auto; }
.hero-pretitle { font-size: .85rem; letter-spacing: .35em; text-transform: uppercase; color: $accent-color; margin-bottom: 14px; font-weight:600; }
.hero-title { font-size: clamp(2.6rem, 4.8vw, 4.2rem); line-height:1.1; font-weight:600; margin:0 0 28px; color:#1f1f22; display:flex; flex-direction:column; align-items:center; gap:14px; }
.hero-title .title-cn { font-size: clamp(1.2rem, 1.6vw, 1.6rem); letter-spacing:.4em; font-weight:500; color:#554330; text-transform:uppercase; opacity:.85; }
.hero-brand { font-size: clamp(3.2rem, 7.2vw, 5.2rem); font-weight:700; background:linear-gradient(100deg,#c8102e,#e8576b 45%, #f4a261 85%); -webkit-background-clip:text; background-clip:text; color:transparent; letter-spacing:.04em; position:relative; padding:4px 18px; }
.hero-brand::after { content:''; position:absolute; inset:0; background:linear-gradient(90deg,rgba(255,255,255,0.25),rgba(255,255,255,0)); mix-blend-mode:overlay; pointer-events:none; border-radius:28px; }
.hero-sub { font-size:1.05rem; max-width:680px; margin:0 auto 30px; color:$text-secondary; line-height:1.6; }

.hero-actions { display:flex; flex-wrap:wrap; gap:18px; justify-content:center; margin-bottom:40px; }
.cta-btn { background:linear-gradient(120deg,#cfa355,#e2c98a); border:none; font-weight:600; padding:16px 34px; border-radius:26px; letter-spacing:.5px; box-shadow:0 6px 20px -6px rgba(170,120,40,0.55); }
.cta-btn:hover { filter:brightness(1.07); }
.cta-btn:active { filter:brightness(.92); }
.secondary-btn { background:linear-gradient(135deg,#264653,#315d6d); border:none; color:#fff; font-weight:600; padding:16px 32px; border-radius:26px; letter-spacing:.5px; box-shadow:0 6px 20px -6px rgba(38,70,83,0.55); }
.secondary-btn:hover { filter:brightness(1.08); }
.secondary-btn:active { filter:brightness(.9); }
.explore-btn { background:linear-gradient(120deg,#c8102e,#e76f51); border:none; color:#fff; font-weight:600; padding:16px 32px; border-radius:26px; letter-spacing:.5px; box-shadow:0 6px 20px -6px rgba(200,16,46,0.45); }
.explore-btn:hover { filter:brightness(1.06); }
.explore-btn:active { filter:brightness(.92); }
.outline-btn { background:rgba(255,255,255,0.55); border:1px solid rgba(180,140,90,0.5); backdrop-filter:blur(10px); font-weight:600; padding:16px 30px; border-radius:26px; letter-spacing:.5px; color:#7a5320; }
.outline-btn:hover { background:rgba(255,255,255,0.82); }
.outline-btn:active { background:rgba(255,255,255,0.42); }

.hero-meta { display:flex; flex-wrap:wrap; gap:18px; justify-content:center; font-size: .75rem; letter-spacing:.15em; text-transform:uppercase; color:$text-muted; opacity:.9; }
.hero-meta span { position:relative; padding:4px 10px; }
.hero-meta span::after { content:''; position:absolute; left:0; bottom:0; width:100%; height:2px; background:linear-gradient(90deg, rgba(200,16,46,0.4), rgba(244,162,97,0.4)); opacity:.4; }

/* 功能网格 */
.features { padding: 40px 20px 30px; }
.section-title { text-align:center; font-size:1.9rem; margin:0 0 34px; font-weight:600; background:linear-gradient(120deg,#c8102e,#e76f51,#f4a261); -webkit-background-clip:text; background-clip:text; color:transparent; letter-spacing:.06em; }
.features-grid { display:grid; gap:26px; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); }

.feature-card { position:relative; padding:22px 20px 26px; background:rgba(255,255,255,0.72); backdrop-filter:blur(14px); border:1px solid rgba(0,0,0,0.05); border-radius:18px; box-shadow:0 4px 14px -4px rgba(0,0,0,0.12); cursor:pointer; transition: transform .45s $ease-out, box-shadow .4s $ease-out, border-color .4s; display:flex; flex-direction:column; gap:10px; }
.feature-card:hover { transform:translateY(-6px) scale(1.015); box-shadow:0 14px 38px -10px rgba(0,0,0,0.18); border-color:rgba(200,16,46,0.35); }
.feature-card h3 { margin:4px 0 0; font-size:1.1rem; font-weight:600; letter-spacing:.5px; color:#202224; }
.feature-card p { margin:0 0 4px; font-size:.82rem; line-height:1.5; color:$text-secondary; flex:1; }
.feature-card :deep(.el-tag) { align-self:flex-start; }
.icon-wrap { width:54px; height:54px; display:flex; align-items:center; justify-content:center; border-radius:16px; font-size:1.85rem; background:linear-gradient(135deg,#ffffff 0%, #f4f4f4 55%, #e9edf2 100%); box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06), 0 4px 10px -2px rgba(0,0,0,0.15); }

/* 价值主张 */
.value-strip { margin: 40px auto 60px; max-width:1180px; display:grid; gap:20px; grid-template-columns: repeat(auto-fit, minmax(260px,1fr)); padding: 10px 18px; }
.value-item { background:linear-gradient(160deg, rgba(255,255,255,0.75), rgba(255,255,255,0.55)); border:1px solid rgba(0,0,0,0.05); border-radius:20px; padding:24px 22px 26px; position:relative; overflow:hidden; backdrop-filter:blur(10px); }
.value-item::before { content:""; position:absolute; inset:0; background:radial-gradient(circle at 85% 25%, rgba(244,162,97,0.28), transparent 60%); opacity:.55; pointer-events:none; }
.value-item h4 { margin:0 0 10px; font-size:1.05rem; font-weight:600; letter-spacing:.5px; color:#222; }
.value-item p { margin:0; font-size:.8rem; line-height:1.55; color:$text-secondary; }

/* 页脚 */
.landing-footer { text-align:center; padding:40px 20px 60px; font-size:.75rem; letter-spacing:.15em; color:$text-muted; }
.landing-footer .sep { margin:0 10px; opacity:.55; }

@media (max-width: 860px) { 
  .hero { padding: 90px 16px 72px; }
  .hero-title { font-size: clamp(2.2rem, 5.2vw, 3.2rem); gap:10px; }
  .hero-brand { font-size: clamp(2.6rem, 10vw, 3.6rem); }
  .hero-actions { gap:14px; margin-bottom:34px; }
  .cta-btn, .secondary-btn, .outline-btn { padding:14px 26px; }
  .features { padding-top: 10px; }
}

@media (max-width: 520px) { 
  .hero-actions { flex-direction:column; }
  .icon-wrap { width:50px; height:50px; font-size:1.6rem; }
  .feature-card { padding:18px 18px 22px; }
  .value-item { padding:20px 18px 22px; }
}
</style>